<template>
    <div>
        <p @click="count++">我是父组件</p>
        <p>{{ userinfo.name }}--{{ userinfo.age }}</p>
        <!-- 使用子组件 -->
        <Son :footableArr1="footableArr" @myevent="getvalue" @myevent1='getvalue1'></Son>
    </div>
</template>

<script setup>
// 引入子组件
import Son from '@/components/Sonview.vue';

import { ref, reactive } from 'vue';
const count = ref(0);
const footableArr = [{ id: 1, name: '王霜' }, { id: 2, name: '王珊珊' }];


// 定义子传父自定义事件对应的事件处理函数
const userinfo = ref({})
const getvalue = (data) => {
    console.log('data', data);
    userinfo.value = data
};

const getvalue1 = (data1) => {
    console.log('data1', data1);
}

</script>
<style scoped></style>